package com.service.atf.base.model;

import com.service.atf.base.core.ByteConvertion;
import com.luotao.devp.base.utils.ByteUtil;

/**
 * User: luotao
 * Date: 12-2-23
 * Time: 15:43:00
 * �û�����	�ַ�char(32)	ʡ����+�б���+SEQ	MP
 * �˻����	����long		MP
 * �������	����long		MP
 * ���ճ�ֵ����	Short		MP
 * ���ճ�ֵ���	long		MP
 * �������ִ���	Short		MP
 * �������ֽ��	long		MP
 * ������Ѵ���	Short		MP
 * ������ѽ��	long		MP
 * ������Ϸʱ��	long		MP
 * ��½ʱ��	Int	2000�굽���ڵĺ�����	MP
 */
public class TFLogin extends BaseHeader implements ByteConvertion {
    //��ֵ���
    private long balcCharge;
    //�������
    private long balcAward;

    private short dailyChargeCount;// DAILYCHARGECOUNT	NUMBER(4)	N	0		���ճ�ֵ����
    private short dailyCashCount;// DAILYCASHCOUNT	NUMBER(4)	N			�������ִ���
    private short dailySaleCount; // DAILYSALECOUNT	NUMBER(4)	N			������Ѵ���

    private short everyDayChargeCount; //	NUMBER(4)	N			�����˻�ÿ�ճ�ֵ�޴�
    private short everyDayCashCount; //	NUMBER(4)	N			�����˻�ÿ�������޴�
    private short everyDaySaleCount; //	NUMBER(4)	N			�����˻�ÿ������޴�

    private long dailyChargeAmount;// DAILYCHARGEAMOUNT	NUMBER(16)	N	0		���ճ�ֵ���
    private long dailyCashAmount;//DAILYCASHAMOUNT	NUMBER(16)	N			�������ֽ��
    private long dailySaleAmount;//DAILYSALEAMOUNT	NUMBER(16)	N			������ѽ��
    private long dailyGameTime;//DAILYGAMETIME	NUMBER(16)	N			������Ϸʱ��

    private long everyDayChargeAmount; //	NUMBER(16)	N			�����˻�ÿ�ճ�ֵ�޶�
    private long everyDayCashAmount; //	NUMBER(16)	N			�����˻�ÿ�������޶�
    private long everyDaySaleAmount; //	NUMBER(16)	N			�����˻�ÿ������޶�
    private long everyDayGameTime; //	NUMBER(8)	N			�����˻�ÿ����Ϸʱ�䣨��λ���룩

    private long customMaxAmount; //          �����˻������
    private long everyChargeAmount; //	N			�����˻�ÿ�ʳ�ֵ�޶�
    private long everyCashMin; //	NUMBER(16)	N			�����˻�ÿ�������޶��ͣ�
    private long everyCashMax; //	NUMBER(16)	N			�����˻�ÿ�������޶��ߣ�
    private long everySaleAmount; //	NUMBER(16)	N			�����˻�ÿ������޶�


    private String token;

    private String lastFlowId;

    private int awardMoney;

    public TFLogin() {
        setType((byte) '1');
        setTradeType((byte) '5');
    }

    public String getCustomerCode() {
        return customerCode;
    }

    public void setCustomerCode(String customerCode) {
        this.customerCode = customerCode;
    }

    public long getBalcCharge() {
        return balcCharge;
    }

    public void setBalcCharge(long balcCharge) {
        this.balcCharge = balcCharge;
    }

    public long getBalcAward() {
        return balcAward;
    }

    public void setBalcAward(long balcAward) {
        this.balcAward = balcAward;
    }

    public short getDailyChargeCount() {
        return dailyChargeCount;
    }

    public void setDailyChargeCount(short dailyChargeCount) {
        this.dailyChargeCount = dailyChargeCount;
    }

    public short getDailyCashCount() {
        return dailyCashCount;
    }

    public void setDailyCashCount(short dailyCashCount) {
        this.dailyCashCount = dailyCashCount;
    }

    public short getDailySaleCount() {
        return dailySaleCount;
    }

    public void setDailySaleCount(short dailySaleCount) {
        this.dailySaleCount = dailySaleCount;
    }

    public long getDailyChargeAmount() {
        return dailyChargeAmount;
    }

    public void setDailyChargeAmount(long dailyChargeAmount) {
        this.dailyChargeAmount = dailyChargeAmount;
    }

    public long getDailyCashAmount() {
        return dailyCashAmount;
    }

    public void setDailyCashAmount(long dailyCashAmount) {
        this.dailyCashAmount = dailyCashAmount;
    }

    public long getDailySaleAmount() {
        return dailySaleAmount;
    }

    public void setDailySaleAmount(long dailySaleAmount) {
        this.dailySaleAmount = dailySaleAmount;
    }

    public long getDailyGameTime() {
        return dailyGameTime;
    }

    public void setDailyGameTime(long dailyGameTime) {
        this.dailyGameTime = dailyGameTime;
    }

    public short getEveryDayChargeCount() {
        return everyDayChargeCount;
    }

    public void setEveryDayChargeCount(short everyDayChargeCount) {
        this.everyDayChargeCount = everyDayChargeCount;
    }

    public short getEveryDayCashCount() {
        return everyDayCashCount;
    }

    public void setEveryDayCashCount(short everyDayCashCount) {
        this.everyDayCashCount = everyDayCashCount;
    }

    public short getEveryDaySaleCount() {
        return everyDaySaleCount;
    }

    public void setEveryDaySaleCount(short everyDaySaleCount) {
        this.everyDaySaleCount = everyDaySaleCount;
    }

    public long getCustomMaxAmount() {
        return customMaxAmount;
    }

    public void setCustomMaxAmount(long customMaxAmount) {
        this.customMaxAmount = customMaxAmount;
    }

    public long getEveryChargeAmount() {
        return everyChargeAmount;
    }

    public void setEveryChargeAmount(long everyChargeAmount) {
        this.everyChargeAmount = everyChargeAmount;
    }

    public long getEveryDayChargeAmount() {
        return everyDayChargeAmount;
    }

    public void setEveryDayChargeAmount(long everyDayChargeAmount) {
        this.everyDayChargeAmount = everyDayChargeAmount;
    }

    public long getEveryCashMin() {
        return everyCashMin;
    }

    public void setEveryCashMin(long everyCashMin) {
        this.everyCashMin = everyCashMin;
    }

    public long getEveryCashMax() {
        return everyCashMax;
    }

    public void setEveryCashMax(long everyCashMax) {
        this.everyCashMax = everyCashMax;
    }

    public long getEveryDayCashAmount() {
        return everyDayCashAmount;
    }

    public void setEveryDayCashAmount(long everyDayCashAmount) {
        this.everyDayCashAmount = everyDayCashAmount;
    }

    public long getEverySaleAmount() {
        return everySaleAmount;
    }

    public void setEverySaleAmount(long everySaleAmount) {
        this.everySaleAmount = everySaleAmount;
    }

    public long getEveryDaySaleAmount() {
        return everyDaySaleAmount;
    }

    public void setEveryDaySaleAmount(long everyDaySaleAmount) {
        this.everyDaySaleAmount = everyDaySaleAmount;
    }

    public long getEveryDayGameTime() {
        return everyDayGameTime;
    }

    public void setEveryDayGameTime(long everyDayGameTime) {
        this.everyDayGameTime = everyDayGameTime;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getLastFlowId() {
        return lastFlowId;
    }

    public void setLastFlowId(String lastFlowId) {
        this.lastFlowId = lastFlowId;
    }

    public int getAwardMoney() {
        return awardMoney;
    }

    public void setAwardMoney(int awardMoney) {
        this.awardMoney = awardMoney;
    }

    @Override
    public ByteConvertion byte2Object(byte[] src) {
        byte2ObjectHeader(src);
        balcCharge = ByteUtil.readLong(src, LEN_HEAD);
        balcAward = ByteUtil.readLong(src, LEN_HEAD + 8);
        dailyChargeCount = (short) ByteUtil.readShort(src, LEN_HEAD + 16);
        dailyCashCount = (short) ByteUtil.readShort(src, LEN_HEAD + 18);
        dailySaleCount = (short) ByteUtil.readShort(src, LEN_HEAD + 20);

        dailyChargeAmount = ByteUtil.readLong(src, LEN_HEAD + 22);
        dailyCashAmount = ByteUtil.readLong(src, LEN_HEAD + 30);
        dailySaleAmount = ByteUtil.readLong(src, LEN_HEAD + 38);
        dailyGameTime = ByteUtil.readLong(src, LEN_HEAD + 46);

        everyDayChargeCount = (short) ByteUtil.readShort(src, LEN_HEAD + 54);
        everyDayCashCount = (short) ByteUtil.readShort(src, LEN_HEAD + 56);
        everyDaySaleCount = (short) ByteUtil.readShort(src, LEN_HEAD + 58);

        customMaxAmount = ByteUtil.readLong(src, LEN_HEAD + 60);
        everyChargeAmount = ByteUtil.readLong(src, LEN_HEAD + 68);
        everyDayChargeAmount = ByteUtil.readLong(src, LEN_HEAD + 76);
        everyCashMin = ByteUtil.readLong(src, LEN_HEAD + 84);
        everyCashMax = ByteUtil.readLong(src, LEN_HEAD + 92);
        everyDayCashAmount = ByteUtil.readLong(src, LEN_HEAD + 100);
        everySaleAmount = ByteUtil.readLong(src, LEN_HEAD + 108);
        everyDaySaleAmount = ByteUtil.readLong(src, LEN_HEAD + 116);
        everyDayGameTime = ByteUtil.readLong(src, LEN_HEAD + 124);
        lastFlowId = ByteUtil.readString(src, LEN_HEAD + 132, 24);
        awardMoney = ByteUtil.readInt(src, LEN_HEAD + 156);
        token = ByteUtil.readString(src, LEN_HEAD + 160, 32);

        return this;
    }

    @Override
    public byte[] object2Byte() {
        byte[] bb = new byte[LEN_HEAD + 192];
        byte[] head = object2ByteHeader();
        System.arraycopy(head, 0, bb, 0, head.length);
        ByteUtil.writeLong(bb, LEN_HEAD, balcCharge);
        ByteUtil.writeLong(bb, LEN_HEAD + 8, balcAward);

        ByteUtil.writeShort(bb, LEN_HEAD + 16, dailyChargeCount);
        ByteUtil.writeShort(bb, LEN_HEAD + 18, dailyCashCount);
        ByteUtil.writeShort(bb, LEN_HEAD + 20, dailySaleCount);

        ByteUtil.writeLong(bb, LEN_HEAD + 22, dailyChargeAmount);
        ByteUtil.writeLong(bb, LEN_HEAD + 30, dailyCashAmount);
        ByteUtil.writeLong(bb, LEN_HEAD + 38, dailySaleAmount);
        ByteUtil.writeLong(bb, LEN_HEAD + 46, dailyGameTime);

        ByteUtil.writeShort(bb, LEN_HEAD + 54, everyDayChargeCount);
        ByteUtil.writeShort(bb, LEN_HEAD + 56, everyDayCashCount);
        ByteUtil.writeShort(bb, LEN_HEAD + 58, everyDaySaleCount);

        ByteUtil.writeLong(bb, LEN_HEAD + 60, customMaxAmount);
        ByteUtil.writeLong(bb, LEN_HEAD + 68, everyChargeAmount);
        ByteUtil.writeLong(bb, LEN_HEAD + 76, everyDayChargeAmount);
        ByteUtil.writeLong(bb, LEN_HEAD + 84, everyCashMin);
        ByteUtil.writeLong(bb, LEN_HEAD + 92, everyCashMax);
        ByteUtil.writeLong(bb, LEN_HEAD + 100, everyDayCashAmount);
        ByteUtil.writeLong(bb, LEN_HEAD + 108, everySaleAmount);
        ByteUtil.writeLong(bb, LEN_HEAD + 116, everyDaySaleAmount);
        ByteUtil.writeLong(bb, LEN_HEAD + 124, everyDayGameTime);
        ByteUtil.writeString(bb, LEN_HEAD + 132, lastFlowId, 24);
        ByteUtil.writeInt(bb, LEN_HEAD + 156, awardMoney);
        ByteUtil.writeString(bb, LEN_HEAD + 160, token, 32);
        return bb;
    }
}
